<template>
 <div class='app'>
<span style="color:#000">home</span>
<input type="text" v-model="username">
<button @click="getlist">发送请求</button>
<router-link to="/bhome">go-bhome</router-link>
 </div>
</template>

<script>
import { getPosiData,getHomeList,getVideo } from "../api/data.js"
   export default {
      data() {
          return {
              username:"你说啥呢",
              id:1111
          }
      },
      //生命周期 - 创建完成
    async created(){ 
       let res=await getPosiData()
       console.log(res)
       let res1=await getVideo()
       console.log(res1)

       let res2=await getHomeList()
       console.log(res2)
     },

     //DOM挂载完毕
     mounted() {

     },
      methods: {
        async getlist(){
            let res=await this.$http.post(`/api/homelist`,{
            username:this.username
    })
        console.log(res)
}

      },
 }
</script>

<style lang='less' scoped>

</style>